package com.qinyeit.codegen.entity;

import com.qinyeit.codegen.GenUtils;

import java.util.List;

/**
 *
 * ClassName: Table <br/> 
 * Function: 表实体 <br/>
 * date: 2015年8月11日 下午3:48:29 <br/> 
 *
 * @author liyang
 * @version 1.0
 * @since JDK 1.7
 */
public class Table {

	private String name = "";
	private String comment = "";
	private boolean isDrop = false;

	private String author = "";

	private List<Column> columns;

	public Table(){
	}

	public Table(String name, String comment){
		this.name = name;
		this.comment = comment;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public boolean isDrop() {
		return isDrop;
	}

	public void setDrop(boolean isDrop) {
		this.isDrop = isDrop;
	}
	/*
	 * 表名骆驼命名，首字母小写，单数
	 */
	public String getHumpName(){
		String str = GenUtils.hump(name);
		return str.substring(0, str.length()-1);
	}

	public String getClassName(){
		return GenUtils.toCaseOne(getHumpName(), true);
	}

	public List<Column> getColumns() {
		return columns;
	}

	public void setColumns(List<Column> columns) {
		this.columns = columns;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}
}
